// 地址相关的的api
import request from '@/utils/request'
/*
* 添加地址
*/
export const addAddress = data => {
  return request({
    method: 'POST',
    url: '/user-receive-address',
    data
  })
}

/*
* 查询地址
*/
export const getAddress = _ => {
  return request({
    method: 'GET',
    url: '/user-receive-address'
  })
}

// 修改收货地址
export const editAddress = (id, data) => {
  return request({
    method: 'PUT',
    url: `/user-receive-address/${id}`,
    data
  })
}

// 删除收货地址
export const deleteAddress = id => {
  return request({
    method: 'DELETE',
    url: `/user-receive-address/${id}`
  })
}
